package edu.famework.demo1;

import java.util.Scanner;

public class TestManager {
    public static void main(String[] args) {

        /**
         * 创建一个Employee类型的数组
         */
        Employee[] employees = new Employee[3];

        /**
         * 向数组中添加三个员工对象
         */
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < employees.length; i++) {

            System.out.println("请输入员工序号：");
            int id = input.nextInt();

            System.out.println("请输入员工姓名：");
            String name = input.next();

            System.out.println("请输入员工工资：");
            double salary = input.nextDouble();

            System.out.println("请输入员工部门：");
            String dept = input.next();

            Employee e = new Employee(id,name,salary,dept);

            employees[i]=e;
        }


        /**
         * 遍历数组，输出每个员工的信息
         */
        for (int i = 0; i < employees.length; i++) {

            Employee e =  employees[i];

            System.out.println(e.getId()+e.getName()+e.getDept()+e.getSalary());

        }


    }

}
